package com.example.lottery.dao.mapper;

import com.example.lottery.dao.dataobject.ActivityUserDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ActivityUserMapper {
    int insert(ActivityUserDO row);

    int insertSelective(ActivityUserDO row);

    ActivityUserDO selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(ActivityUserDO row);

    int updateByPrimaryKey(ActivityUserDO row);

    int insertList(@Param("activityUserDOS") List<ActivityUserDO> activityUserDOS);

    List<ActivityUserDO> selectUserInfoByActivityId(@Param("activityId")Long activityId);


    int updateStatus(@Param("userIds") List<Long> userIds, @Param("status")String status, @Param("activityId")Long activityId);


    List<ActivityUserDO> selectUAInfo(@Param("userIds") List<Long> userIds, @Param("activityId") Long activityId);

    /**
     * 获取userIds
     * @param userIds
     * @param activityId
     * @return
     */
    List<Long> selectUAId(@Param("userIds") List<Long> userIds, @Param("activityId") Long activityId);

    List<Long> selectUserIdsByActivityId(@Param("activityId") Long activityId);

    /**
     * 返回状态为status的记录个数
     * @param winnerIds
     * @param activityId
     * @param status
     * @return
     */
    int selectUAStatus(@Param("winnerIds") List<Long> winnerIds, @Param("activityId") Long activityId, @Param("status") String status);
}